/**
 * 订单打印
 * 
 * @param {}
 *            orderId
 * @return {}
 */
var printThermalOrderWindows = function(orderId) {
	var printThermalOrderFormPanel = new Ext.form.FormPanel({
				id : 'printThermalOrderForm',
				frame : true,
				width : '35%',
				region : 'center',
				border : false,
				bodyBorder : false,
				monitorValid : true,
				layout : 'form',
				buttonAlign : 'center',
				buttons : [{
							text : "打印",
							width : 80,
							formBind : true,
							handler : function() {
								printThermalOrderHandle();
							}
						}, {
							text : "取消",
							width : 80,
							handler : function() {
								printThermalOrderWin.close();
							}
						}],
				items : [{
							xtype : 'displayfield',
							fieldLabel : "订单编号",
							ctCls : 'zhaospaceCSS3',
							value : orderId
						}, {
							xtype : "hidden",
							name : "orderId",
							anchor : '100%',
							value : orderId
						}, {
							xtype : 'getAllPrintServiceCmb',
							fieldLabel : '打印机名称',
							editable : false,
							allowBlank : false,
							id : 'contractBarcode_printServiceName',
							hiddenName : 'printServiceName'
						}]
			});
	var printThermalOrderWin = new Ext.Window({
				title : '订单热敏打印',
				closeAction : 'close',
				id : 'printThermalOrderWin',
				width : 400,
				height : 200,
				closable : true,
				plain : true,
				modal : true,
				maximizable : false,
				layout : 'fit',
				items : [printThermalOrderFormPanel]
			});
	return printThermalOrderWin;
}
/**
 * 订单打印
 */
function printThermalOrderHandle() {
	var printForm = Ext.getCmp("printThermalOrderForm");
	if (printForm.getForm().isValid()) {
		Ext.Msg.confirm("信息确认", "您确定要打印吗？", function(c) {
				if (c == "yes") {
						printForm.getForm().submit({
							url : __ctxPath + "/orderManager/printThermalOrder",
							method : "post",
							timeout : 600000,// 10分钟超时,
							waitTitle : "请稍候",
							waitMsg : "正在提交打印，请稍候......",
							success : function(c, d) {
								Ext.MessageBox.show({
											title : "操作信息",
											msg : "打印订单信息成功!",
											buttons : Ext.MessageBox.OK,
											icon : Ext.MessageBox.INFO
										});
								Ext.getCmp("printThermalOrderWin").close();
							},
							failure : function(c, d) {
								Ext.MessageBox.show({
											title : "操作信息",
											msg : '打印订单信息失败!',
											buttons : Ext.MessageBox.OK,
											icon : Ext.MessageBox.ERROR
										});
							}
						});
					}
				});
	}
}